package com.shop2cn.iapi.sellerpromotion.service;

import java.util.ArrayList;

import com.google.gson.reflect.TypeToken;
import com.shop2cn.iapi.sellerpromotion.parameter.PromotionDetail;
import com.ymatou.iapi.livebuyer.parameter.LiveRoomInfo;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*满减详情
*FreeMaker Template自动生成代码
*/
public class PromotionDetailCall extends YmatouBaseCall{
	private static String opurl ="manage/detail";
	
	public PromotionDetailCall() {
		super(EnvSetup.getSystemUrl("sellerpromotion_shop2cn_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public PromotionDetail getData()
    {
		PromotionDetail data = null;
        try {
        	String data2=getJsonObject().get("data").getAsJsonObject().toString();
        	data=(PromotionDetail) FormatUtil.GSONToObject(data2, new TypeToken<PromotionDetail>() {}.getType());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
    }
}